class SessionStore{
    get(key){
        let value = sessionStorage.getItem(key) || ''
        if(/^[\[\{]/.test(value)){
            value = JSON.parse(value)
        }
        return value
    }
    set(key,value){
        if(typeof value == 'object'){
            value = JSON.stringify(value)
        }
        sessionStorage.setItem(key,value)
    }
    del(key){
        sessionStorage.removeItem(key)
    }
}

export default new SessionStore
